import request from '@/util/request'
import type { Cart } from './types'

const api: string = 'dishes-service/cart'

export const saveOrUpdate = (data: Cart) => {
    return request({
        url: api,
        method: 'post',
        data
    })
}

export const getCartList = () => {
    return request<Cart[], Cart[]>({
        url: api,
        method: 'get'
    })
}

export const deleteFormCart = (ids: number[] | string[]) => {
    return request<any, any>({
        url: api + '/' + `${ids}`,
        method: 'delete'
    })
}
